function ret = mi_randtraing( u, a, b, c )
	if( !( u>=0 && u <= 1 && a < b && b < c ) || length(u) <= 0 )
		printf("Error en parametros.\n");
		ret = NaN;
	else
		ret = 0;
		for i = [1:length(u)]
			if( u(i) < 0 )#a/c )
				ret(i) = 0;
			elseif( u(i) <= (b-a)/(c-a) )
				ret(i) = a + sqrt((c-a)*(b-a)*u(i));
			else
				ret(i) = c - sqrt((c-a)*(c-b)*(1-u(i)));
				#printf("ret = %g : %g - %g*%g*%g/2\n",ret, c, sqrt(2*(1-u)), (c-b), (c-a) );
			endif
		endfor
	endif
endfunction
